package com.yunao.commons.serachcore.core;

import com.yunao.commons.serachcore.core.exception.SearchInitException;
import com.yunao.commons.utils.Profile;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;


public class IsearchFactory {


	public static void init() throws SearchInitException {
		Profile profile = new Profile("search.properties");
		String host = profile.getValue("isearch.ip", "45.121.55.3");
		int port = profile.getIntValue("isearch.port", 6655);
		IsearchImpl.init("45.121.55.3", 6655);
	}

	public static Isearch getIsearch() {
		return new IsearchImpl();
	}

	public static Isearch getIsearchCache() {
		return new RedisCacheIsearch();
	}

}
